<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	response.setHeader("Pragma", "No-Cache");
	response.setHeader("Cache-Control", "No-Cache");
	response.setDateHeader("Expires", 0);
	String id=request.getParameter("diseaseid")==null?null:request.getParameter("diseaseid");
%>
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base target="_self" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>药典管理-疾病添加</title>
		<link type="text/css" rel="stylesheet"
			href="${pageContext.request.contextPath}/drugUI/css/style.css" />
		<link type="text/css" rel="stylesheet"
			href="${pageContext.request.contextPath}/drugUI/css/main.css" />
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/drugUI/js/util.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/drugUI/js/jquery1.4.2.min.js"></script>
	</head>
	<body scroll="no">
		<div id="container">
			<div id="content"
				style="border: 0px solid #aecbd4; overflow-x: hidden; overflow-y: scroll;">
				<form name="myForm" method="post" id="myForm">
					<div class="current">
						<div class="current_con">
							<div class="help">
								<a href="#"><img
										src="${pageContext.request.contextPath}/drugUI/image/help.gif"
										title="帮助"
										onclick="showLayer('C6','${pageContext.request.contextPath}')" />
								</a>
							</div>
							<span>_当前位置：</span> 药典管理 >><%=id==null?"疾病添加":"疾病修改"%>
						</div>
					</div>
					<table width="100%" border="0" cellpadding="3" cellspacing="1"
						class="table02">
						<tr>
							<td width="15%" class="tName">
								<span style="color: red">*</span>疾病名称
							</td>
							<td>
							<input name="diseaseid" type="hidden" id="diseaseid" value="${disease.diseaseid}"/>
							<input name="diseasename" type="text" id="diseasename" value="${disease.diseasename}"/>
							</td>
							<td width="15%" class="tName">
								<span style="color: red">*</span>疾病编码
							</td>
							<td width="35%">
								<input name="code" type="text" id="code" value="${disease.code}"/>
							</td>
						</tr>
						<tr>
							<td width="15%" class="tName">
								<span style="color: red">*</span>疾病类型
							</td>
							<td>
								<select name="diseaseType.typeid" id="typeid" STYLE="width: 150px">
									<c:forEach items="${diseaseTypeList}" var="p">
										<option value="${p.typeid}" <c:if test="${disease.diseaseType.typeid == p.typeid }">
                                                selected
                                            </c:if>>
											${p.typename}
										</option>
									</c:forEach>
								</select>
							</td>
							<td width="15%" class="tName">
								<span style="color: red">*</span>疾病助记符
							</td>
							<td width="35%">
								<input name="symbol" type="text" id="symbol"   value='${disease.symbol}'/>
							</td>
						</tr>
						<tr>
							<td width="15%" class="tName">
								疾病定义
							</td>
							<td width="35%">
								<textarea name="definition" style="width: 100%; height: 60px; overflow-y: hidden;" id="definition">${disease.definition}</textarea>
							</td>
							<td width="15%" class="tName">
								疾病描述
							</td>
							<td width="35%">
								<textarea name="desp" style="width: 100%; height: 60px; overflow-y: hidden;" id="desp">${disease.desp}</textarea>
							</td>
						</tr>
						<tr>
							<td class="tName">
								疾病诊断依据
							</td>
							<td colspan="3">
								<textarea name="according" style="width: 100%; height: 60px; overflow-y: hidden;" id="according">${disease.according}</textarea>
							</td>
							
						</tr>
						<tr>
							<td colspan="4" align="center">
								<input type="button" name="BSave" value="保 存"
									onclick="javascript:showHandleDialog();" id="BSave"
									class='btn02' />
								&nbsp;
								<input type="button" name="btnBack" value="关 闭"
									onclick="javascript: closeWindow();" id="btnBack" class='btn02' />
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		<script language="javascript" type="text/javascript">
	   function showHandleDialog() {
	   var type='<%=request.getParameter("type")%>';
		document.myForm.action = "disease.saveOrUpdate.action?type="+type;
		document.myForm.submit();
	}
	function closeWindow() {
		window.returnValue = "ok";
		window.close();
	}
	function statusInfo() {
	    var status = "${status}";
		if (status == "0")
			alert("保存疾病成功！");
		else if (status == "1") {
			alert("保存疾病失败，请联系管理员或重新添加！");
			return false;
		}
		if (status != "")
			closeWindow();	
	}
	/**
	 * 自动调整对话框高度
	 */
	 function resize()
	 {
		var height = document.getElementById("container").offsetHeight; 
		dialogResize( 450 );
		var divName = document.getElementById("content");
		divName.style.height = 400 + "px";
	 }
	window.onload = function() {
	    statusInfo();
		resize();
	};
            window.onresize = function(){
				var tmp = "";
        		var ua = navigator.userAgent.toLowerCase();
        		if (window.ActiveXObject)
            		if(ua.match(/msie ([\d.]+)/)[1]=="6.0")
                		tmp = parseInt(window.dialogHeight) - 100;
				else tmp = parseInt(window.dialogHeight) - 50;
                var divName = document.getElementById("content");
                divName.style.height = tmp + "px";
            };
</script>
	</body>
</html>